import 'package:flutter/material.dart';
import 'package:surfaceim/common/middlewares/middlewares.dart';
import 'package:surfaceim/pages/application/index.dart';
import 'package:surfaceim/pages/basicInformation/index.dart';
import 'package:surfaceim/pages/cancellation/binging.dart';
import 'package:surfaceim/pages/cancellation/view.dart';
import 'package:surfaceim/pages/category/index.dart';
import 'package:surfaceim/pages/community/binding.dart';
import 'package:surfaceim/pages/community/view.dart';
import 'package:surfaceim/pages/frame/notfound/index.dart';
import 'package:surfaceim/pages/frame/sign_in/index.dart';
import 'package:surfaceim/pages/frame/sign_up/index.dart';
import 'package:surfaceim/pages/frame/terms_of_service/index.dart';
import 'package:surfaceim/pages/frame/user_agreement/index.dart';
import 'package:surfaceim/pages/frame/welcome/index.dart';
import 'package:get/get.dart';
import 'package:surfaceim/pages/user/baseInfo/binding.dart';
import 'package:surfaceim/pages/user/baseInfo/view.dart';
import 'package:surfaceim/pages/user/editInfo/emotionalConcept/binging.dart';
import 'package:surfaceim/pages/user/editInfo/emotionalConcept/view.dart';
import 'package:surfaceim/pages/user/editInfo/pureFononess/binding.dart';
import 'package:surfaceim/pages/user/editInfo/pureFononess/view.dart';

import 'routes.dart';

class AppPages {
  static const INITIAL = AppRoutes.INITIAL;
  static final RouteObserver<Route> observer = RouteObservers();
  static List<String> history = [];

  static final List<GetPage> routes = [
    // 免登陆
    GetPage(
      name: AppRoutes.INITIAL,
      page: () => WelcomePage(),
      binding: WelcomeBinding(),
      middlewares: [
        RouteWelcomeMiddleware(priority: 1),
      ],
    ),
    GetPage(
      name: AppRoutes.SIGN_IN,
      page: () => SignInPage(),
      binding: SignInBinding(),
    ),
    GetPage(
      name: AppRoutes.SIGN_UP,
      page: () => SignUpPage(),
      binding: SignUpBinding(),
    ),
    // 用户协议
    GetPage(
      name: AppRoutes.USER_AGREEMENT,
      page: () => UserAgreementPage(),
      binding: UserAgreementBinding(),
    ),

    // 服务条款
    GetPage(
      name: AppRoutes.TERMS_OF_SERVICE,
      page: () => TermsOfServicePage(),
      binding: TermsOfServiceBinding(),
    ),

    /// 需要登录的页面
    GetPage(
      name: AppRoutes.Application,
      page: () => ApplicationPage(),
      binding: ApplicationBinding(),
      middlewares: [
        // RouteAuthMiddleware(priority: 1),
      ],
    ),

    // 基本信息
    GetPage(
      name: AppRoutes.BASIC_INFORMATION,
      page: () => BasicinformationPage(),
      binding: BasicinformationBinding(),
    ),

    // 分类列表
    GetPage(
      name: AppRoutes.Category,
      page: () => CategoryPage(),
      binding: CategoryBinding(),
    ),
    GetPage(
      name: AppRoutes.Community,
      page: () => CommunityPage(),
      binding: CommunityBinding(),
    ),
    GetPage(
        name: AppRoutes.Cancellation,
        page: () => CancellationPage(),
        binding: CancellationBinding()),
    GetPage(
        name: AppRoutes.Emotional_Concept,
        page: () => EmotionalConceptPage(),
        binding: EmotionalConceptBind()),
    GetPage(
        name: AppRoutes.Pure_Fononess,
        page: () => PureFononessPage(),
        binding: PureFononessBind()),
    GetPage(
        name: AppRoutes.Base_Info,
        page: () => BaseInfoPage(),
        binding: BaseInfoBinding())
  ];

  static final unknownRoute = GetPage(
    name: AppRoutes.NotFound,
    page: () => NotfoundPage(),
  );
}
